home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / MPWLibsDebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-17  |  2.6 KB  |  76 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3.     MPWLibsDebug.h
  4.     
  5.     Used to disable/enable extended argument-checking with the
  6.     debugging versions of certain MPW libraries. 
  7.  
  8.     Copyright Apple Computer,Inc.  1996
  9.     All rights reserved
  10.  
  11.  
  12.  ************************************************************/
  13.  
  14. #ifndef __MPWLIBDEBUG__
  15. #define __MPWLIBDEBUG__
  16.  
  17. #if defined(__powerpc) || defined(powerpc) || defined (__CFM68K__) 
  18.     #pragma import on
  19. #endif
  20.  
  21. #if __cplusplus
  22. extern "C" {
  23. #endif  /* __cplusplus */
  24.  
  25. extern short AssertMPWLibsGlobal;
  26.     /* Set AssertsGlobal to 0 to turn off all assertion-checking. */
  27.     /* Default value is 1. */
  28.  
  29. extern short AssertOnSettingErrno;
  30.     /* Set AssertOnSettingErrno to 1 to turn on assertions that indicate */
  31.     /* that errno has been set to non-zero. */
  32.     /* The default value is 0. */
  33.  
  34. extern short AssertOnCharRange;
  35.     /* Set AssertOnCharRange to 1 to check that an int argument representing         */
  36.     /* a character falls within 0...UCHAR_MAX (0...255 for MrC and SC).             */
  37.     /* Since ctype functions allow EOF, the check also                                 */
  38.     /* allows -1 for those functions only.                                             */
  39.     /* The default value for AssertOnCharRange is 0.                                 */
  40.  
  41. extern short AssertOnZeroLengths; 
  42.     /* Set AssertOnZeroLengths to 1 to check that length arguments are not             */
  43.     /* equal to zero for functions like memcpy(), malloc(), realloc(), calloc(),     */
  44.     /* fread, fwrite, memchr, memcchr, memmove(), etc.                                 */
  45.     /* The default value for AssertOnZeroLengths is 0.                                 */
  46.  
  47. extern short AssertOnNullsExceptZeroSize; 
  48.     /* Set AssertOnNullsExceptZeroSize to 1 to avoid assertions on NULL pointers         */
  49.     /* when the size/length argument to a function is zero.  Set to 0 to always     */
  50.     /* generate assertions when pointers are equal to NULL.                            */
  51.     /* The default value for AssertOnNullsExceptZeroSize is 1.                         */
  52.  
  53. extern short AssertOnNullFrees;
  54.     /* Set AssertOnNullFrees to 1 to check that the pointer input argument             */
  55.     /* to free() is not null.                                                         */
  56.     /* The default value for AssertOnNullFrees is 0.                                 */
  57.  
  58. extern short AssertOnNullReallocs;
  59.     /* Set AssertOnNullReallocs to 1 to check that the pointer input argument         */
  60.     /* to realloc() is not null.                                                     */
  61.     /* The default value for AssertOnNullReallocs is 0.                             */
  62.  
  63. void __DebugMallocHeap( void );
  64.     /* Call this function at program-exit to check that all allocations made by     */
  65.     /* malloc/calloc have been freed.                                 */
  66.  
  67. #if __cplusplus
  68. }
  69. #endif  /* __cplusplus */
  70.  
  71. #if defined(__powerpc) || defined(powerpc) || defined (__CFM68K__) 
  72.     #pragma import off
  73. #endif
  74.  
  75. #endif  /* __MPWLIBDEBUG__ */
  76.